import request from '@/utils/request'

// 查询问卷调查列表
export function listInvestigation(query) {
  return request({
    url: '/questionnaire/investigation/list',
    method: 'get',
    params: query
  })
}
export function listInvestigationOrgId(query) {
  return request({
    url: '/questionnaire/investigation/listOrgId',
    method: 'get',
    params: query
  })
}

// g根据客户id查询问卷调查列表
export function listByEnterpriseId(query) {
  return request({
    url: '/questionnaire/investigation/listByEnterpriseId',
    method: 'get',
    params: query
  })
}

// 查询待问卷调查列表
export function listInvestigationByExamine(query) {
  return request({
    url: '/questionnaire/investigation/listByExamine',
    method: 'get',
    params: query
  })
}

// 查询问卷调查列表
export function listInvestigationHis(query) {
  return request({
    url: '/questionnaire/investigation/hisList',
    method: 'get',
    params: query
  })
}

// 查询问卷调查详细
export function getInvestigation(questionnaireId) {
  return request({
    url: '/questionnaire/investigation/' + questionnaireId,
    method: 'get'
  })
}

// 新增问卷调查
export function addInvestigation(data) {
  return request({
    url: '/questionnaire/investigation',
    method: 'post',
    data: data
  })
}

// 修改问卷调查
export function updateInvestigation(data) {
  return request({
    url: '/questionnaire/investigation',
    method: 'put',
    data: data
  })
}

// 删除问卷调查
export function delInvestigation(questionnaireId) {
  return request({
    url: '/questionnaire/investigation/' + questionnaireId,
    method: 'delete'
  })
}

//审核问卷
export function examineInvestigation(data) {
  return request({
    url: '/questionnaire/investigation/examine',
    method: 'post',
    data: data
  })
}

//查询问卷发送企业列表
export function sendList(query) {
  return request({
    url: '/questionnaire/investigation/sendList',
    method: 'get',
    params: query
  })
}

//查询当前用户问卷接收列表
export function receptionList(query) {
  return request({
    url: '/questionnaire/investigation/receptionList',
    method: 'get',
    params: query
  })
}

export function submitReview(id) {
  return request({
    url: '/questionnaire/investigation/SubmitReview/' + id,
    method: 'get'
  })
}

export function toExamine(id) {
  return request({
    url: '/questionnaire/investigation/toExamine/' + id,
    method: 'get'
  })
}
